import { EntitySchema, Ref } from '@mikro-orm/core';
import { JobTasks } from './JobTasks';

export class JobTasksPictures {
  id!: string;
  task?: Ref<JobTasks>;
  type?: string;
  url?: string;
}

export const JobTasksPicturesSchema = new EntitySchema({
  class: JobTasksPictures,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    task: {
      reference: 'm:1',
      entity: () => JobTasks,
      ref: true,
      nullable: true,
      index: 'job_tasks_id',
    },
    type: { type: 'string', length: 255, nullable: true },
    url: { type: 'string', length: 500, nullable: true },
  },
});
